#delimit;
set more off;

capture clear;

capture log close;

set mem 500m;

set logtype text;

log using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/log_files/run_regressions_levels_no_CT_log.log, replace;


/*****************************************************************************************
*
* This do file runs the regressions for the Joint and Several Liability Reforms and 
* Accidental Deaths paper.  These regressions are in Tables 5 through 9 of the paper.  
* 
* Program by Dan Carvell, written between Summer 2007 and Summer 2010.  
*
* Note that there are commands in this do file to use the outreg command to create 
* regression output tables.  However, these outreg commands had to be commented out when 
* I ran this do file on a new server that Columbia University installed in 2011.  I could
* get the outreg command to work on Columbia's old cluster, however as of July 2011 I have
* not yet been able to get outreg to work on the new cluster, for some unknown reason.
*
*****************************************************************************************/







/* Open dataset with accidental death rate variables, tort reform variables, and controls    */


use "/hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/cleaned_data_for_regressions/Clean_Data_Deaths.dta", clear;


** In this version of this do file we drop data from Connecticut from the sample, as this is the one state that went straight from a ;
** regime of JSL without contribution to having a JSL reform                                                                                                     ;

drop if statefip==9;












/* Regressions for Table 5     */

/* Remember that deathrate_no_OD is the rate of deaths from accidents other than auto accidents and drug overdoses ,  */
/* OD_rate is the rate of fatal overdoses on illegal drugs and abused pharmaceuticals, just_auto_raw is the rate of   */
/* fatal auto accidents, and not_at_hosp_rate is the rate of accidental deaths were the person is pronounced dead     */
/* at a location other than a hospital - for instance they were pronounced dead at the scene of the accident - and    */
/* where the cause of death was an accident other than a drug overdose or an auto accident                            */
/* Other note - when the dependent variable is the rate of auto accidents, the JSL reform variable is an indicator    */
/* for the presence of a JSL reform that applies in all auto accident tort suits.  This is because there are a few    */
/* JSL reforms that do not apply in every type of tort suit over auto accidents - drunk drivers are sometimes an      */
/* exception, and Hawaii's JSL reform does not apply in nearly all tort suits over auto accidents                     */




xi:  regress deathrate_no_OD o_jsl_0 unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel addnote("SEs clustered by state  regressions include state and year FE and state specific time trends") bdec(4) bfmt(f) nocons coefastr se bracket 10pct replace;



xi:  regress deathrate_no_OD o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress OD_rate o_jsl_0 unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress OD_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress just_auto_raw o_jsl_0_auto unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0_auto unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress just_auto_raw no_fault_auto_any compulsory_auto o_jsl_0_auto o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg no_fault_auto_any compulsory_auto o_jsl_0_auto o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress not_at_hosp_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_5_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;
































/*  Regressions for Table 6               */
/*  Remember, the dependent variables for these regressions are the rates of accidental deaths within different age groups for causes other than  */
/*  drug overdoses and auto accidents                                                                                                             */


xi:  regress rate_ages_0_5 o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority sy* i.year i.statefip [aweight=ages_0_to_5], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_6_Levels_no_CT, nolabel addnote("SEs clustered by state  regressions include state and year FE and state specific time trends") bdec(4) bfmt(f) nocons coefastr se bracket 10pct replace;



xi:  regress rate_ages_6_17 o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority sy* i.year i.statefip [aweight=ages_6_to_17], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_6_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress rate_ages_18_64 o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority sy* i.year i.statefip [aweight=rate_ages_18_64], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_6_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress rate_ages_65_above o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_other_minority sy* i.year i.statefip [aweight=age_65_or_above], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_6_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;

















/*  Regressions for Table 7          */



xi:  regress deathrate_no_OD o_jsl_0_new o_jsl_0_yr2 o_csr_new o_csr_yr2 o_nedcap_new o_nedcap_yr2 o_pd_reform_new o_pd_reform_yr2 mms_nedcap_new mms_nedcap_yr2 unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0_new o_jsl_0_yr2 o_csr_new o_csr_yr2 o_nedcap_new o_nedcap_yr2 o_pd_reform_new o_pd_reform_yr2 mms_nedcap_new mms_nedcap_yr2 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_7_Levels_no_CT, nolabel addnote("SEs clustered by state  regressions include state and year FE and state specific time trends") bdec(4) bfmt(f) nocons coefastr se bracket 10pct replace;



xi:  regress deathrate_no_OD o_jsl_0_new3 o_jsl_0_yr3 o_csr_new3 o_csr_yr3 o_nedcap_new3 o_nedcap_yr3 o_pd_reform_new3 o_pd_reform_yr3 mms_nedcap_new3 mms_nedcap_yr3 unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0_new3 o_jsl_0_yr3 o_csr_new3 o_csr_yr3 o_nedcap_new3 o_nedcap_yr3 o_pd_reform_new3 o_pd_reform_yr3 mms_nedcap_new3 mms_nedcap_yr3 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_7_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



xi:  regress deathrate_no_OD o_jsl_0_new4 o_jsl_0_yr4 o_csr_new4 o_csr_yr4 o_nedcap_new4 o_nedcap_yr4 o_pd_reform_new4 o_pd_reform_yr4 mms_nedcap_new4 mms_nedcap_yr4 unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0_new4 o_jsl_0_yr4 o_csr_new4 o_csr_yr4 o_nedcap_new4 o_nedcap_yr4 o_pd_reform_new4 o_pd_reform_yr4 mms_nedcap_new4 mms_nedcap_yr4 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_7_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



















/*  Regressions for Table 8        */


xi:  regress deathrate_no_OD o_jsl_0 o_jsl_0_lead_2 unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_jsl_0_lead_2 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_8_Levels_no_CT, nolabel addnote("SEs clustered by state  regressions include state and year FE and state specific time trends") bdec(4) bfmt(f) nocons coefastr se bracket 10pct replace;




xi:  regress deathrate_no_OD o_jsl_0 o_jsl_0_lead_2 o_csr o_csr_lead_2 o_nedcap o_nedcap_lead_2 o_pd_reform o_pd_reform_lead_2 mms_nedcap mms_nedcap_lead_2 unemp_rate per_capita_alcohol hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_jsl_0_lead_2 o_csr o_csr_lead_2 o_nedcap o_nedcap_lead_2 o_pd_reform o_pd_reform_lead_2 mms_nedcap mms_nedcap_lead_2 unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_8_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;





















/*  Regressions for Table 9            */

/*  Regression for Falls               */


xi:  regress fall_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel addnote("SEs clustered by state  regressions include state and year FE and state specific time trends") bdec(4) bfmt(f) nocons coefastr se bracket 10pct replace;



/*  Regression for Drownings           */


xi:  regress drowning_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



/*  Regression for Suffocations        */


xi:  regress suffocate_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



/*  Regression for Fires and Burns     */


xi:  regress fire_burn_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



/*  Regression for Non-Drug-Overdose Poisonings     */


xi:  regress poisonNotOD_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



/*  Regression for Transportation Accidents other than Automobile Accidents     */


xi:  regress o_trnsprt_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;



/*  Regression for Firearm Accidents   */


xi:  regress firearm_VS_rate o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate per_capita_alcohol real_income hospbeds_capita prct_Afr_Amer prct_other_minority prct_under_four prct_elderly prct_young_males sy* i.year i.statefip [aweight=population], robust cluster(statefip);

** outreg o_jsl_0 o_csr o_nedcap o_pd_reform mms_nedcap unemp_rate using /hmt/hpcstorage1/hpc/sscc/work/projects/ccm/CCM/CCM-RAND_for_posting_on_Dataverse/data/outreg_regression_output_tables/Paper_Table_9_Levels_no_CT, nolabel bdec(4) bfmt(f) nocons coefastr se bracket 10pct append;






















log close;

